#include <stdio.h>

int main(void)
{
    int n;
    double temp;
    int arr[10] = {0};
    scanf("%d", &n);
    for (int i = 0; i < n; i++)
    {
        scanf("%lf", &temp);
        while (temp >= 1)
        {
            arr[(int)temp % 10]++;
            temp /= 10;
        }
    }
    for (int i = 0; i < 10; i++)
    {
        if (arr[i] > 0)
        {
            printf("%d:%d\n", i, arr[i]);
        }
    }
    return 0;
}